package com.bit.java;

public class Test2 {

    public static void swap(int x, int y) {   //这里的 a b 为形式参数
        int ret = x;
        x = y;
        y = ret;
    }

    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println("交换前");
        System.out.println(a + " " + b);

        swap(a, b);
        System.out.println("交换后");
        System.out.println(a + " " + b);
    }

}
